home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c,comp.graphics.algorithms,rec.games.programmer
- Subject: Re: Speed question here...
- Date: 16 Feb 96 12:16:19 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.824472979@rscernix>
- References: <4ftluh$1gkv@hearst.cac.psu.edu> <4fvjqnINN84p@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4fvjqnINN84p@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
-
- >In article <4ftluh$1gkv@hearst.cac.psu.edu>,
- >William Koscho <koscho@wjk130.rh.psu.edu> wrote:
- >>I was curious as to how fast something like the
- >>following would execute:
- >
- >I don't know? How fast can your compiler tell you that the program can't be
- >compiled?
- >
- >> int x;
- >> node *ptr; ptr in linked list
- >>
- >> for ( ptr = first_node; ptr != NULL; ptr = ptr.next ) {
- >
- >You don't dereference pointers by doing ptr.field. You use *(ptr).field, or,
-
- You misspelled (*ptr).field. *(ptr).field is the same as *ptr.field and
- both are illegal because the dot operator has higher precedence.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-